package com.application.fabric.fabriccontrol.operate.serverfabric;


import com.application.fabric.fabriccontrol.fabricinit.connect.Congateway;
import org.hyperledger.fabric.gateway.Contract;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Repository;

@Repository
public class ServeAssetbasic02 {
    /*这是查询全部资产的指令
     * 那么运行前我们可以得到合约了 所以先注入合约初始化
     * */
    @Autowired
    private Congateway congateway;

    /*初始化资产*/

    public String ReadAsset(String assetid) throws Exception{
//        Contract contract = Congateway.initstatus02();
        Contract contract = congateway.initstatus02();
        byte[] result= contract.submitTransaction("ReadAsset",assetid);

        return new String(result);
    }
}
